package cn.ml.utils.shiJianChuo;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Time01 {
    public static void main(String[] args) {

        //LocalDateTime
        LocalDateTime now = LocalDateTime.now();
        //年月日时分秒毫秒
        System.out.println(now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")));
        //年月日时分秒毫秒
        System.out.println(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss:SSS")));
        //生成年月日
        System.out.println(now.format(DateTimeFormatter.ISO_DATE));
        System.out.println(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        //年月日时分秒
        System.out.println(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));



    }

}
